﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PlayingCardLib;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;

namespace WriteCards
{
    class Program
    {
        static void Main(string[] args)
        {
            Deck deck = new Deck();
            PlayingCard card;
            IFormatter bfmt = new BinaryFormatter();

            using (Stream stream = File.Create(@"C:\Projects\cards"))
            {
                for (int i = 0; i < 10; i++)
                {
                    card = deck.DealTopCard();
                    bfmt.Serialize(stream, card);
                    
                }

                stream.Close();
            }


            Console.WriteLine("Done");
            Console.ReadLine();
        }
    }
}
